<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //柯里化思想
        
        function add(a, b, c) {
            return a + b + c
        }
			function toCurrying(fn) {
				function curried(...args) {
					if (args.length >= fn.length) {
						return fn.apply(this, args)
					} else {
						return function (...args2) {
							return curried.apply(this, args.concat(args2))
						}
					}
				}
				return curried
			}

			const bar = toCurrying(add)

			console.log(bar(25)(15)(10))
    </script>
</body>

</html>